package com.yzd.learnjava.io;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import com.yzd.learnjava.util.Print;

public class BufferedInputFile {
	public static String read(String filename) throws IOException {
		BufferedReader reader = new BufferedReader(new FileReader(filename));
		String s;
		StringBuilder builder = new StringBuilder();
		while((s = reader.readLine()) != null) {
			builder.append(s + "\n" );
		}
		return builder.toString();
	}
	
	public static void main(String[] args) throws IOException {
		Print.print(read("D:\\src\\git\\java\\javalearn\\src\\com\\yzd\\learnjava\\util\\PPrint.java"));
	}
}
